package com.huoteng.entity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by huoteng on 7/9/15.
 */
@Entity
@Table(name = "got_url", schema = "", catalog = "search")
public class GotUrl {
    private int id;
    private String url;
    private Date data;
    private String title;
    private String content;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "url")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "data")
    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GotUrl gotUrl = (GotUrl) o;

        if (id != gotUrl.id) return false;
        if (url != null ? !url.equals(gotUrl.url) : gotUrl.url != null) return false;
        if (data != null ? !data.equals(gotUrl.data) : gotUrl.data != null) return false;
        if (title != null ? !title.equals(gotUrl.title) : gotUrl.title != null) return false;
        if (content != null ? !content.equals(gotUrl.content) : gotUrl.content != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (data != null ? data.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        return result;
    }
}
